package gamesrv.tictactoe;

import org.osgi.framework.*;

import gamesrv.gameprovider.api.GameProvider;



public class Activator implements BundleActivator {
	ServiceRegistration<?> srvToken;
	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
		System.out.println("Tictactoe: started!");
		
		GameProvider provider = new GameProviderImpl();
		srvToken = context.registerService(GameProvider.class, provider, null);
	}
	
	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
		srvToken.unregister();
		System.out.println("Tictactoe: stopped!");
	}

}
